package main

import "fmt"

func main() {
	c5 := make(chan int, 5)
	c5 <- 111
	c5 <- 222
	c5 <- 333
	c5 <- 0

	fmt.Println(<-c5, "###")
	fmt.Println(<-c5, "###")
	fmt.Println(<-c5, "###")

	fmt.Println("~~~~~~~~~~~~~~~~~~~~~~~")
	close(c5) // 关闭通道
	x, ok := <-c5
	fmt.Println(x, ok, "!!!!")
	x, ok = <-c5
	fmt.Println(x, ok, "!!!!")
	x, ok = <-c5
	fmt.Println(x, ok, "!!!!")

	fmt.Println("$$$$$$$$$$$$$$$$$$$$$$$$$")
}
